package com.net.xpay.core.domain.safePay;

import com.net.common.domain.VersionedDomain;
import com.net.xpay.core.enums.SafePayOrderStatus;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 安全发单笔记录
 */
@Getter
@Setter
@NoArgsConstructor
public class SafePayOrder extends VersionedDomain {

    @ApiModelProperty(notes = "用户id")
    private Long userId;

    @ApiModelProperty(notes = "合伙人id")
    private Long partnerId;

    @ApiModelProperty(notes = "父级合伙人id")
    private Long fatherPartnerId;

    @ApiModelProperty(notes = "免费 新用户测试送的 不扣钱")
    private Boolean free;

    @ApiModelProperty(notes = "支付宝账号")
    private String alipayNickName;

    @ApiModelProperty(notes = "safePayBatchId")
    private Long safePayBatchId;

    @ApiModelProperty(notes = "导入的商户的批次号 必选")
    private String importBatchNo;

    @ApiModelProperty(notes = "safePayBookAccountId")
    private Long safePayBookAccountId;

    @ApiModelProperty(notes = "资金记账本id")
    private String bookId;

    @ApiModelProperty(notes = "支付宝签约协议号")
    private String agreementNo;

    @ApiModelProperty(notes = "明细外部订单号 env + user_id + '-' + id")
    private String outBizNo;

    @ApiModelProperty(notes = "导入的明细外部订单号 必选")
    private String importBizNo;

    @ApiModelProperty(notes = "明细金额 单位为元（最小1元），精确到小数点后两位 必选")
    private BigDecimal transAmount;

    @ApiModelProperty(notes = "转账业务的标题，用于在支付宝用户的账单里显示")
    private String orderTitle;

    @ApiModelProperty(notes = "转账备注，收款方如果是支付宝账号，会展示在收款方账单里 非必选")
    private String remark;

    @ApiModelProperty(notes = "收款方账号，传入支付宝账号或者支付宝uid或者银行卡号 test@taobao.com 必选")
    private String identity;

    @ApiModelProperty(notes = "1.当identity传入支付宝账号时，identity_type传ALIPAY_LOGON_ID 2.当当identity传入支付宝uid时，identity_type传ALIPAY_USER_ID 3.TAOBAO_NICKNAME 旺旺 必选")
    private String identityType;

    @ApiModelProperty(notes = "参与方真实姓名，如果非空，将校验收款支付宝账号姓名一致性。当identity_type传ALIPAY_LOGON_ID时此字段必选")
    private String name;

    @ApiModelProperty(notes = "支付宝支付资金流水号，仅当转账成功才会返回该参数")
    private String payFundOrderId;

    @ApiModelProperty(notes = "支付宝转账单据号")
    private String orderId;

    @ApiModelProperty(notes = "状态")
    private SafePayOrderStatus status;

    @ApiModelProperty(notes = "开始触发打款时间")
    private LocalDateTime startTime;

    @ApiModelProperty(notes = "打款成功完成时间")
    private String transDate;

    @ApiModelProperty(notes = "完成时间")
    private LocalDateTime endTime;

    @ApiModelProperty(notes = "明细失败错误码")
    private String errorCode;

    @ApiModelProperty(notes = "明细失败错误原因")
    private String errorMsg;

    public static SafePayOrder getInstance() {
        return new SafePayOrder();
    }
}
